package tracksystem;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import managesystem.Student;
import managesystem.StudentManager;
/**
 * 
 * @author Incalza Dario
 *
 */
public class CancelActivityServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	/**
	 * Afhandelen van de informatie van het formulier
	 */
	public void doGet(HttpServletRequest req, HttpServletResponse resp) {
		HttpSession session = req.getSession();
		Student currStud = (Student) session.getAttribute("currStud");
		currStud.setUnfinishedActivity(null);
		StudentManager.add(currStud); //updaten van het studentObject in de database.
		session.setAttribute("currStud", currStud);
		try {
			resp.sendRedirect("/");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}